﻿using System.Collections.Generic;

using SwyishChess.Domain.Piece;

namespace SwyishChess.Domain.Move
{
    public class ChessMovesModel
    {
        /// <summary>
        /// To keep track of moves
        /// </summary>
        public List<ChessMove> MoveTracker { get; set; }
        /// <summary>
        /// To keep track of undoed moves
        /// </summary>
        public List<ChessMove> UndoedMoveTracker { get; set; }

        /// <summary>
        /// Default constructor that initalizes both move tracker list and undoed move tracker list
        /// </summary>
        public ChessMovesModel()
        {
            MoveTracker = new List<ChessMove>();
            UndoedMoveTracker = new List<ChessMove>();
        }

        /// <summary>
        /// Gets the last moved chess piece object
        /// </summary>
        /// <returns>Last moved chess piece object</returns>
        public ChessPiece GetLastMovedChessPiece()
        {
            return MoveTracker[MoveTracker.Count - 1].ChessPiece;
        }
    }
}
